{include file="public/head"/}
<script language="javascript">
    $(document).ready(function () {
        var lang = $('#lang').text();
        var language = '';
        if (lang == 'pt-br') {
            language = 'pt-BR';
            format = 'mm/dd/yyyy';
        } else if (lang == 'en-us') {
            language = 'en';
            format = 'mm/dd/yyyy';
        } else {
            language = 'zh-CN';
            format = 'yyyy-mm-dd'
        }
        //设置modal垂直居中,移动
        modalSetting(".modal");
        // datatimepicker 设置
        $('.form_datetime').datetimepicker({
            language: language, // en ,zh-CN, pt-BR
            format: format,
            minView: 'month',
            weekStart: 0, //一周从哪一天开始
            todayBtn: 1, //
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            showMeridian: 1
        });
    });
</script>

<div id="main">
<!--search框开始-->
<div class="row clearfix" id="search-box" style="display:none;margin-top:0">
    <div class="col-md-12 text-right">
        <div>
            <form class="form-inline" role="form">

                <div class="form-group">
                    <label for="name">search{:lang('add/alterar_bank_account')}</label>
                    <input type="text" class="form-control" id="name" placeholder="请输入公司名称，产品名称，型号，角色ID" v-model="search">
                </div>
                <div class="form-group">
                    <button type="button" class="btn btn-default btn-primary" @click="getdata()"><span class="glyphicon glyphicon-search"></span>{:lang('search')}</button>
                </div>
            </form>
		</div>
	</div>
</div>

<!--search框结束-->


<div class="container-fluid" >

    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="alert alert-dismissable alert-info" ref="alert">
                <button type="button" class="close">×</button>
                <p ref="info"></p>
            </div>
        </div>
    </div>
   
   
    <div class="ntDesktop">
    	<div class="ntDesktop-head">{:lang("purchase_plan_list")}</div>
    
        <div class="row clearfix" style="padding-top:0px">
            <div class="col-md-2 text-right">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#" data-toggle="tab" @click="changeitem(0)"> 产品</a></li>
                    <li><a href="#" data-toggle="tab" @click="changeitem(1)">{:lang("accessory")}</a></li>
                </ul>
            </div>
            <div class="col-md-5 text-right" v-cloak>
                <ul class="nav nav-tabs">
                    <!-- <li class="active"><a href="#" data-toggle="tab" >本月以前</a></li> -->
                    <li :class="{'active':index==0}" v-for="(item,index) in montharr"><a href="#" data-toggle="tab" @click="changemonth(item.year,item.month)"><!--  {{item.month}}月 -->{{index==0 ? '本月' : item.month+'月'}}</a></li>
                </ul>            	
            </div>
            <div class="col-md-5 text-right">
                <div>
                    <a href="{:url('buy/plan_addnew')}" class='btn btn-primary' ><span class="glyphicon glyphicon-plus"></span> {:lang("add_purchase_plan")}</a>
                    <a href="javascript:;" class='btn btn-primary' @click="banckfun"><span class="fa fa-file-powerpoint"></span> {:lang("purchase_plan_generation_contract")}</a>
                    <button class='btn btn-default' @click="delfun(batch)"><span class="glyphicon glyphicon-trash"></span> {:lang('batch_delete')}</button>
                </div>
            </div>
        </div>
    
        <div class="row clearfix">
            <div class="col-md-12 column">
                <input type="hidden" ref="waner" value="请选择要生成合同的计划">
                <table class="table table-striped table-hover ntTable" v-cloak>
                    <thead>
                        <tr>
                            <th style="text-align:center"><input type="checkbox" id="allche" @click="allsel" /> </th>
                            <th class="sorting"> No. </th>
                            <th>&nbsp;  </th>
                            <th> {:lang('product')} </th>
                            <th> {:lang("quantity")} </th>
                            <th> {:lang("box_measure")} </th>
                            <th> {:lang("price")} </th>
                            <th> {:lang("purchase")} </th>
                            <th class="sorting"> {:lang("delivery_time")} </th>
                            <th> {:lang('edit')} </th>
                            <th> {:lang('operate')} </th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr v-for="(item,index) in listdata" :key="item.id">
                            <td style="vertical-align:middle" class="text-center"><input type="checkbox"  @click="onesel(item.id)" /></td>
                            <td style="vertical-align:middle">{{item.id}}</td>
                            <td style="vertical-align:middle"><img :src="item.img_url" border="0"></td>
                            <td> <small>{{item.id + (item.brand_name ? '/'+item.brand_name : '') + (item.model ? '/'+item.model : '')}}</small> <br />{{item.pro_name}}</td>
                            <td> {{item.qty}} <span class="unit">CTN</span><br /> {{item.qty_sum}} <span class="unit">PCS</span></td>
                            <td>
                            	{{item.ctn_qty}} <span class="unit">PCS/CTN</span> | {{item.ctn_kgs}} <span class="unit">KGS</span><br>
                                {{item.ctn_size}} <span class="unit">CM</span> | {{item.ctn_m3}} <span class="unit">CBM</span>
                            </td>
                            <td> {{item.price}} <span class="unit">CNY</span><br> {{item.price_sum}} <span class="unit">CNY</span></td>
                            <td> {{item.nickname}} <br> <small> {{item.company_name}} </small> </td>
                            <td> {{item.delivery_time}} <br /> <small>{{item.address}}</small> </td>
                            <td> {{item.create_name}} <br /><small> {{item.create_time}} </small></td>
                            <td style="vertical-align:middle" class="text-right">
                                <div>
                                  <a :href="'/admin/buy/plan_editnew?id='+item.id" class='btn btn-sm btn-primary'><span class="glyphicon glyphicon-pencil"></span> {:lang('edit')}</a>
                                  <a href="#" class='btn btn-sm btn-default' @click="delfun(item.id)"><span class="glyphicon glyphicon-trash"></span> {:lang('delete')}</a>
                                </div>
                            </td>
                        </tr>
                        <tr><td colspan="11" style="text-align: center;font-size: 16px;" v-if="listdata.length==0">{:lang('no_data')}</td></tr>
                    </tbody>
                </table>
                <ul class="pagination" id="pagination">
                    </ul>
            </div>
        </div>
    </div>
</div>
</div>
<script src="/static/Admin/js/plan.js"></script>
{include file="public/foot"/}